/* 该方法在流转过程中会自动调用,千万不能删除,否则会出现脚本调用异常 */
function changdangfawen_() {
	/* 添加自定义的函数脚本 */
	if (arguments && arguments.length) {
		if (typeof arguments[0] == 'string' && arguments[0] == 'save') {
			window.location.href = context
					+ '/system/flowlist.do?method=mypendinglist';
		} else if (typeof arguments[0] == 'string'
				&& (arguments[0] == 'send' || arguments[0] == 'finish')) {
			window.location.href = context
					+ '/system/flowlist.do?method=mydonelist';
		} else if (typeof arguments[0] == 'string' && arguments[0] == 'back') {
			window.location.href = context
					+ '/system/flowlist.do?method=mypendinglist';
		} else if (typeof arguments[0] == 'string' && arguments[0] == 'finish') {
			window.location.href = context
					+ '/system/flowlist.do?method=mypendinglist';
		} else if (typeof arguments[0] == 'string' && arguments[0] == 'cancel') {
			window.location.href = context
					+ '/system/flowlist.do?method=mypendinglist';
		} else if (typeof arguments[0] == 'string'
				&& (arguments[0] == 'neu' || arguments[0] == 'edit'
						|| arguments[0] == 'view' || arguments[0] == 'lookover')) {
			var frm = getFrameInParent('menuFrm');

			if (arguments[0] == 'neu') {
				/* 发文机关 */
				$('COL_UBKBBAHYQZ_label').innerHTML = groupflumelabel;
				$('COL_UBKBBAHYQZ').value = groupflumelabel;

				/* 拟稿人 */
				$('COL_GEXXHGOBDT_label').innerHTML = username;
				$('COL_GEXXHGOBDT').value = username;

				/* 拟稿时间 */
				$('COL_OWVGHPOQXC_label').innerHTML = tdate;
				$('COL_OWVGHPOQXC').value = tdate1;
			}
		}
	}

	/* 调整父窗口frame高度 */
	if (parent.resizeFrame) {
		parent.resizeFrame(document.getElementsByTagName("body")[0].scrollHeight);
	}
}

/**
 * 套红函数
 * 
 * @param {}
 *            obj
 */
function doTaoHong(obj) {
	var docHeader = serverPath + context
			+ '/application/changdangfawen/red/head.doc';
	var docFooter = serverPath + context
			+ '/application/changdangfawen/red/foot.doc';

	// 文件头部插入文件
	obj.InSertFile(docHeader, 1);
	// 文件尾部插入文件
	obj.InSertFile(docFooter, 2);

	copyValue(obj);
}

/**
 * 复制书签
 * 
 * @param {}
 *            obj
 */
function copyValue(obj) {
	var obj = obj.GetDocumentObject();
	var all_sq = "COL_YWQJAXBKOS,COL_OJRLHSFTIC,COL_UBKBBAHYQZ,tdate";
	var all_sq_array = all_sq.split(",");
	for (var i = 0; i < all_sq_array.length; i++) {
		if (document.getElementById(all_sq_array[i]) != null) {
			var the_value = document.getElementById(all_sq_array[i]).value;
			if (obj.Bookmarks.Exists(all_sq_array[i])) {
				var bkmkObj = obj.BookMarks(all_sq_array[i]);
				var saverange = bkmkObj.Range;
				saverange.Text = the_value;
				obj.Bookmarks.Add(all_sq_array[i], saverange);
			}

		}
	}

}